#ifndef __WENX_CSB__
#define __WENX_CSB__
#include "MCF52259.h"
extern unsigned int range;

void display(unsigned int range);
void delay(void);
void start(void);
void stop(void);
void ack(void);
void no_ack();
void i2c_write_byte(unsigned char dat);
unsigned char i2c_read_byte(void);
void init_i2c(void);
void write_byte(unsigned char address,unsigned char reg,unsigned char command);
unsigned char read_byte(unsigned char address,unsigned char reg);
unsigned int detect(unsigned char address,unsigned char command); //0xe8(address) + 0xb0(command)

uint16 getdistance();
uint16 iffull();
#endif